<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<style>
<!--
.searchContent td label{
width:50px;
}
-->
</style>
<form id="pagerForm" method="post" onsubmit="return divSearch(this,'show_scl_list');"	action="school_search.action">
	<input type="hidden" name="pageNum" value="${currentPage }" /> 
	<input type="hidden" name="numPerPage" value="${numPerPage}" /> 
	<input type="hidden" name="orderField" value="${param.orderField}" /> 
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	<input type="hidden" name="checkStatusFlag" value="${checkStatusFlag}" />
	<input type="hidden" name="balanceTypeFlag" value="${balanceTypeFlag}" />
	<input type="hidden" name="saleUserId" value="${saleUserId}" />
	<input type="hidden" name="deptCode" value="${deptCode}" />
	<input type="hidden" name="countyCode" value="${countyCode}" />
	<input type="hidden" name="areaCode" value="${areaCode}" />
	<input type="hidden" name="sclNumber" value="${sclNumber}" />
	<input type="hidden" name="sclName" value="${sclName}" />
</form>
<div>
	
		<c:choose>
		<c:when test="${!empty errorMsg}">
		<div class="panelBar">
			
				<div style="line-height: 25px;margin-right: 20px;font-weight: normal;text-align: center;color: red;">
					${errorMsg }
				</div>
			
		</div>
		</c:when>
		</c:choose>
	
	
	<c:if test="${empty errorMsg}">

	<table class="table" width="100%" layoutH="150">
		<thead>
			<tr>
				<th width="" align="center">序号</th>
				<th width="" >地区</th>
				<th width="" >学校名称</th>
				<th width="" >学校编号</th>
				<th width="" >集团客户ID</th>
				<th width="" >卡类型</th>
				<th width="" >移动客户经理</th>
				<th width="" >拓展人员</th>
				<th width="" >维护人员</th>
				<th width="" >激励方式</th>
				<th width="" >结算方式</th>
				<th width="" >省外电话</th>
				<th width="" >业务状态</th>
				<th width="" >审核状态</th>
				<th width="" >创建时间</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${recordList}" var="school" varStatus="status">
			<tr target="school_id" rel="${school.sclId }" onclick="school_doSelect(this)">
				<td>${(status.index+1) + (currentPage-1) * numPerPage}
					<input type="hidden"  id="isuId" value="${currentUser.userId}">
					<input type="hidden"  id="isuRoleCode" value="${currentUser.insideUser.isuRoleCode}">
					<input type="hidden"  id=createOperId value="${school.createOperId}">
					<input type="hidden" name="checkStatusFlag" id="checkStatusFlag_${status.index}" value="${school.checkStatusFlag}"/>
					<input type="hidden" id="groupCode" value="${currentUser.insideUser.isuGroupCode}">
					<input type="hidden" id="limitTelareaFlag_${status.index}" value="${school.limitTelareaFlag}">
					<input type="hidden" id="bizStatusFlag_${status.index}" value="${school.bizStatusFlag}">
				</td>
				<td>
					${application.areaMap[school.areaCode] }
				</td>
				<td>${school.sclName }</td>
				<td>${school.sclNumber }</td>
				<td>
					<input type="hidden" id="school_ecId_${status.index}" value="${school.ecId }">
					<c:forEach var="ecInfo" items="${bossEcinfoList}">
	 					<c:if test="${ecInfo.ecId == school.ecId }">
							<a title="${ecInfo.ecName }" >${school.ecId}</a>
						</c:if>
					</c:forEach>
				</td>
				<td>
				${school.cardTypeFlag == "0" ?"M1":"FR" }</td>
				<td>
					<c:forEach var="mobManager" items="${mobManagerList}">
	 					<c:if test="${mobManager.osuId == school.mobManagerId }">
							${mobManager.osuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<c:forEach var="sale" items="${saleList}">
	 					<c:if test="${sale.isuId == school.saleUserId }">
							${sale.isuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<c:forEach var="maintain" items="${saleList}">
	 					<c:if test="${maintain.isuId == school.saleKeepId }">
							${maintain.isuName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<c:forEach var="marketing" items="${marketingTypeList}">
	 					<c:if test="${marketing.dicCode == school.marketingTypeFlag }">
							${marketing.dicName}
						</c:if>
					</c:forEach>
				
				</td>
				<td>
					<c:forEach var="blance" items="${blanceTypeList}">
	 					<c:if test="${blance.dicCode == school.balanceTypeFlag }">
							${blance.dicName}
						</c:if>
					</c:forEach>
				</td>
				<td>
					<c:if test="${school.limitTelareaFlag eq '0'}">允许
					</c:if>
					<c:if test="${school.limitTelareaFlag eq '1'}">禁止
					</c:if>
				</td>
				<td>
					<%--此字段暂时无用，此处显示IS_EXTEND
					<c:if test="${school.bizStatusFlag eq '0'}"><a style="color:red;text-decoration:none;" >停用</a>
					</c:if>
					<c:if test="${school.bizStatusFlag eq '1'}">启用
					</c:if> --%>
					<c:if test="${school.isExtend eq '1'}"><a style="color:green;text-decoration:none;" >拓展阶段</a>
					</c:if>
					<c:if test="${school.isExtend eq '2'}">运维阶段
					</c:if> 
				</td>
				<td>
					<c:choose>
						<c:when test="${school.checkStatusFlag =='1'}">
							<a style="color:green;text-decoration:none;" >
								已审核
							</a>
						</c:when>
						<c:when test="${school.checkStatusFlag =='0'}">
							<a style="color:red;text-decoration:none;" >
								未审核
							</a>
						</c:when>
					</c:choose>
				</td>
				<td>
					<fmt:parseDate value="${school.inputTime}" var="inTime" pattern="yyyyMMddHHmmss"/>  
					<fmt:formatDate value="${inTime}" pattern="yyyy-MM-dd" /> 
				</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	
	<div class="panelBar">
						<div class="pages">
							<span>显示</span> <select class="combox" name="numPerPage"
								onchange="navTabPageBreak({numPerPage:this.value}, 'show_scl_list')">
								<option value="10" <c:if test="${pageSize==10}">selected</c:if>>10</option>
								<option value="20" <c:if test="${pageSize==20}">selected</c:if>>20</option>
								<option value="30" <c:if test="${pageSize==30}">selected</c:if>>30</option>
								<option value="40" <c:if test="${pageSize==40}">selected</c:if>>40</option>
								<option value="50" <c:if test="${pageSize==50}">selected</c:if>>50</option>
								<option value="100"
									<c:if test="${pageSize==100}">selected</c:if>>100</option>
							</select> <span>条，共${recordCount}条</span>
						</div>
						<div class="pagination" rel="show_scl_list"
							totalCount="${recordCount}" numPerPage="${pageSize}"
							pageNumShown="5" currentPage="${currentPage}"></div>
					</div>
</c:if>
</div>	
	
	
<script type="text/javascript">
function school_doSelect(obj){
	var ecIdValue = $("#school_ecId_"+obj.rowIndex,navTab.getCurrentPanel()).val();
	var bindLink = $("#school_bindEcid",navTab.getCurrentPanel());
	if(ecIdValue!="" ){
		bindLink.hide();
		$("#school_bindEcid_line").hide();
	}else{
		bindLink.show();
		$("#school_bindEcid_line").show();

	}
	var checkStatus=$("#checkStatusFlag_"+obj.rowIndex,navTab.getCurrentPanel()).val();
	var limitTelareaFlag=$("#limitTelareaFlag_"+obj.rowIndex,navTab.getCurrentPanel()).val();
	var bizStatusFlag=$("#bizStatusFlag_"+obj.rowIndex,navTab.getCurrentPanel()).val();
	//var isuRoleCode=document.getElementById("isuRoleCode").value;
	var groupCode=document.getElementById("groupCode").value;
	var isuId=document.getElementById("isuId").value;
	var createOperId=document.getElementById("createOperId").value;
	var school_check=$("#school_check",navTab.getCurrentPanel());
	if(limitTelareaFlag=='0'){
		$("#school_phone_allow").hide();
		$("#school_phone_notAllow").show();
	}else{
		$("#school_phone_allow").show();
		$("#school_phone_notAllow").hide();
	}
	if(groupCode=='1000'){//如果登录人属于管理组,都能进行修改
		/* $("#edit1").hide();
		$("#edit2").show(); */
		if(checkStatus=="0"){
			school_check.show();
			$("#school_check_line").show();
		}else{
			school_check.hide();
			$("#school_check_line").hide();
		}
		if(bizStatusFlag=="0"){
			$("#school_bizStatus_1").show();
			$("#school_bizStatus_0").hide();
		}else{
			$("#school_bizStatus_1").hide();
			$("#school_bizStatus_0").show();
		}
	}else{//如果登录人不属于管理组
		/* if(isuId==createOperId){//如果是创建人
				$("#edit1").hide();
				$("#edit2").show();
		}else{
			$("#edit1").show();
			$("#edit2").hide();
		} */
		
	}
}
function message(){
	alertMsg.info("您没有权限进行修改!");
}
</script>